﻿namespace Churchtoolkit.Web.Shell.Presenters
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    using Churchtoolkit.DataAccess.Repositories;
    using Churchtoolkit.Utils.MVP;

    public class MessagePresenter : Presenter
    {
        #region Fields

        private NotificationsRepository _notificationsRepository;

        #endregion Fields

        #region Constructors

        public MessagePresenter(NotificationsRepository notificationsRepository)
        {
            _notificationsRepository = notificationsRepository;
        }

        #endregion Constructors

        #region Methods

        public string GetMessage(string messageCode)
        {
            return _notificationsRepository.Find(notification => notification.Code = messageCode).Single().Description;
        }

        #endregion Methods
    }
}